<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>i2c: C:/Users/Jon/Downloads/OOP/old/inc/functions.php Source File</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">i2c
   
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
<div class="header">
  <div class="headertitle">
<div class="title">C:/Users/Jon/Downloads/OOP/old/inc/functions.php</div>  </div>
</div>
<div class="contents">
<a href="old_2inc_2functions_8php.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 &lt;?php
<a name="l00002"></a>00002 
<a name="l00008"></a><a class="code" href="old_2inc_2functions_8php.html#aca07cf60afd49a5a5b583459f5423045">00008</a> <span class="keyword">function</span> <a class="code" href="db-control_2inc_2functions_8php.html#aca07cf60afd49a5a5b583459f5423045">connectToDatabase</a>() {
<a name="l00009"></a>00009         require <span class="stringliteral">&#39;dbInfo.php&#39;</span>;
<a name="l00010"></a>00010         <a class="code" href="db_install_8php.html#a0a71190f67ae9de9e6f5ababdad0e938">$db_server</a> = mysql_connect(<a class="code" href="old_2inc_2db_info_8php.html#af2db2dddb0b2b7d808588f5cda0b91cf">$db_hostname</a>, <a class="code" href="old_2inc_2db_info_8php.html#a820e0b38cf4374967d8018835e9b755d">$db_username</a>, <a class="code" href="old_2inc_2db_info_8php.html#a2962c2bda65ca19dd4dd12d7160f1bf8">$db_password</a>);
<a name="l00011"></a>00011         <span class="keywordflow">if</span> (!<a class="code" href="db_install_8php.html#a0a71190f67ae9de9e6f5ababdad0e938">$db_server</a>
<a name="l00012"></a>00012         )die(<span class="stringliteral">&quot;Cannot connect to the MySQL database!&lt;br /&gt;Please contact your database administrator.&quot;</span>);
<a name="l00013"></a>00013         mysql_select_db(<a class="code" href="old_2inc_2db_info_8php.html#a33c3c5391829c0397ae04ddcac20473e">$db_database</a>) or die(<span class="stringliteral">&quot;Cannot select the database!&lt;br /&gt;Please make sure it has been installed properly!&quot;</span>);
<a name="l00014"></a>00014 }
<a name="l00015"></a>00015 
<a name="l00020"></a><a class="code" href="old_2inc_2functions_8php.html#a670611c688faf5381e11ce55cb7dc889">00020</a> <span class="keyword">function</span> <a class="code" href="old_2inc_2functions_8php.html#a670611c688faf5381e11ce55cb7dc889">showCategories</a>(<a class="code" href="db-control_2inc_2db_info_8php.html#ab2fc40d43824ea3e1ce5d86dee0d763b">$name</a>) {
<a name="l00021"></a>00021 
<a name="l00022"></a>00022         <a class="code" href="admin_2internship__list_8php.html#a112ef069ddc0454086e3d1e6d8d55d07">$result</a> = mysql_query(<span class="stringliteral">&quot;SELECT name FROM categories&quot;</span>);
<a name="l00023"></a>00023         <span class="keywordflow">if</span> (!<a class="code" href="admin_2internship__list_8php.html#a112ef069ddc0454086e3d1e6d8d55d07">$result</a>
<a name="l00024"></a>00024         )die(<span class="stringliteral">&quot;Could not complete the query...&quot;</span>);
<a name="l00025"></a>00025         <a class="code" href="internship__list__dateadded_8php.html#a421991d6ab7f46f80cc1b5492e0c236e">$numRows</a> = mysql_num_rows(<a class="code" href="admin_2internship__list_8php.html#a112ef069ddc0454086e3d1e6d8d55d07">$result</a>);
<a name="l00026"></a>00026         echo <span class="stringliteral">&quot;&lt;form action=&#39;index.php&#39; method=&#39;post&#39;&gt;&quot;</span>;
<a name="l00027"></a>00027         echo <span class="stringliteral">&quot;&lt;div align=&#39;left&#39;&gt;Category: &lt;select onchange=&#39;this.form.submit()&#39; name=&#39;categoryChange&#39;&gt;&lt;/div&gt;&quot;</span>;
<a name="l00028"></a>00028         <span class="keywordflow">if</span> (<a class="code" href="db-control_2inc_2db_info_8php.html#ab2fc40d43824ea3e1ce5d86dee0d763b">$name</a> == null) {
<a name="l00029"></a>00029                 echo <span class="stringliteral">&quot;&lt;option SELECTED value=&#39;&#39;&gt;ALL&lt;/option&gt;&quot;</span>;
<a name="l00030"></a>00030         } <span class="keywordflow">else</span> {
<a name="l00031"></a>00031                 echo <span class="stringliteral">&quot;&lt;option value=&#39;&#39;&gt;ALL&lt;/option&gt;&quot;</span>;
<a name="l00032"></a>00032         }
<a name="l00033"></a>00033         <span class="keywordflow">for</span> ($i = 0; $i &lt; <a class="code" href="internship__list__dateadded_8php.html#a421991d6ab7f46f80cc1b5492e0c236e">$numRows</a>; $i++) {
<a name="l00034"></a>00034                 $row = mysql_fetch_assoc(<a class="code" href="admin_2internship__list_8php.html#a112ef069ddc0454086e3d1e6d8d55d07">$result</a>);
<a name="l00035"></a>00035                 <span class="keywordflow">if</span> ($row[name] == <a class="code" href="db-control_2inc_2db_info_8php.html#ab2fc40d43824ea3e1ce5d86dee0d763b">$name</a>) {
<a name="l00036"></a>00036                         echo <span class="stringliteral">&quot;&lt;option SELECTED value=&#39;$row[name]&#39;&gt;$row[name]&lt;/option&gt;&quot;</span>;
<a name="l00037"></a>00037                 } <span class="keywordflow">else</span> {
<a name="l00038"></a>00038                         echo <span class="stringliteral">&quot;&lt;option value=&#39;$row[name]&#39;&gt;$row[name]&lt;/option&gt;&quot;</span>;
<a name="l00039"></a>00039                 }
<a name="l00040"></a>00040         }
<a name="l00041"></a>00041         echo <span class="stringliteral">&quot;&lt;/select&gt;&quot;</span>;
<a name="l00042"></a>00042         echo <span class="stringliteral">&quot;&lt;/form&gt;&quot;</span>;
<a name="l00043"></a>00043 }
<a name="l00044"></a>00044 
<a name="l00050"></a><a class="code" href="old_2inc_2functions_8php.html#ac1b9b6235dfdcf4b5e61f181ae2827d6">00050</a> <span class="keyword">function</span> <a class="code" href="old_2inc_2functions_8php.html#ac1b9b6235dfdcf4b5e61f181ae2827d6">filterDate</a>() {
<a name="l00051"></a>00051 
<a name="l00052"></a>00052         $categories = <a class="code" href="logout_8php.html#aa3f93905a0a94ad29ddd47d9e5638098">$_SESSION</a>[<span class="stringliteral">&#39;category&#39;</span>];
<a name="l00053"></a>00053         <a class="code" href="internship__list__dateadded_8php.html#af59a5f7cd609e592c41dc3643efd3c98">$query</a> = <span class="stringliteral">&quot;SELECT o.city, o.state, o.name, io.* FROM INTERNSHIP_OPPORTUNITY io, ORGANIZATION o WHERE io.organizationID = o.OrganizationID AND io.categories LIKE &#39;%$categories%&#39; ORDER BY io.dateAdded DESC&quot;</span>;
<a name="l00054"></a>00054 
<a name="l00055"></a>00055         <a class="code" href="admin_2internship__list_8php.html#a112ef069ddc0454086e3d1e6d8d55d07">$result</a> = mysql_query(<a class="code" href="internship__list__dateadded_8php.html#af59a5f7cd609e592c41dc3643efd3c98">$query</a>);
<a name="l00056"></a>00056         <span class="keywordflow">if</span> (!<a class="code" href="admin_2internship__list_8php.html#a112ef069ddc0454086e3d1e6d8d55d07">$result</a>
<a name="l00057"></a>00057         )die(<span class="stringliteral">&quot;Could not complete query...&quot;</span>);
<a name="l00058"></a>00058         <a class="code" href="internship__list__dateadded_8php.html#a421991d6ab7f46f80cc1b5492e0c236e">$numRows</a> = mysql_num_rows(<a class="code" href="admin_2internship__list_8php.html#a112ef069ddc0454086e3d1e6d8d55d07">$result</a>);
<a name="l00059"></a>00059         echo <span class="stringliteral">&quot;&lt;table width=&#39;100%&#39; cellspacing=0&gt;&lt;tr&gt;&lt;td width=&#39;10%&#39;&gt;&lt;/td&gt;&lt;td&gt;&lt;b&gt;Location&lt;/b&gt;&lt;/td&gt;&lt;td&gt;&lt;b&gt;Position&lt;/b&gt;&lt;/td&gt;&lt;td&gt;&lt;b&gt;Company&lt;/b&gt;&lt;/td&gt;&lt;td width=&#39;10%&#39;&gt;&lt;b&gt;Positions Available&lt;/b&gt;&lt;/td&gt;&lt;td&gt;&lt;b&gt;Pay Rate&lt;/b&gt;&lt;/td&gt;&lt;td&gt;&lt;b&gt;Semester&lt;/b&gt;&lt;/td&gt;&lt;td width=&#39;30%&#39;&gt;&lt;b&gt;Date Added&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;&quot;</span>;
<a name="l00060"></a>00060         echo <span class="stringliteral">&quot;&lt;tr&gt;&lt;td colspan=8&gt;&lt;hr /&gt;&lt;/td&gt;&lt;/tr&gt;&quot;</span>;
<a name="l00061"></a>00061         <span class="keywordflow">for</span> ($x = 0; $x &lt; <a class="code" href="internship__list__dateadded_8php.html#a421991d6ab7f46f80cc1b5492e0c236e">$numRows</a>; $x++) {
<a name="l00062"></a>00062                 $row = mysql_fetch_assoc(<a class="code" href="admin_2internship__list_8php.html#a112ef069ddc0454086e3d1e6d8d55d07">$result</a>);
<a name="l00063"></a>00063                 <span class="keywordflow">if</span> ($x % 2 == 0) {
<a name="l00064"></a>00064                         echo <span class="stringliteral">&quot;&lt;tr&gt;&quot;</span>;
<a name="l00065"></a>00065                 } <span class="keywordflow">else</span> {
<a name="l00066"></a>00066                         echo <span class="stringliteral">&quot;&lt;tr bgcolor=&#39;#FBFBFB&#39;&gt;&quot;</span>;
<a name="l00067"></a>00067                 }
<a name="l00068"></a>00068                 echo <span class="stringliteral">&quot;&lt;td align=&#39;center&#39; valign=&#39;middle&#39;&gt;&lt;br /&gt;&lt;form action=&#39;index.php&#39; method=&#39;post&#39;&gt;&lt;input type=&#39;hidden&#39; name=&#39;viewCompany&#39; value=&#39;$row[organizationID]&#39;&gt;&lt;input type=&#39;submit&#39; value=&#39;View&#39; class=&#39;submit&#39; name=&#39;view&#39; /&gt;&lt;/form&gt;&lt;/td&gt;&quot;</span>;
<a name="l00069"></a>00069                 echo <span class="stringliteral">&quot;&lt;td&gt;$row[city], &quot;</span> . strtoupper($row[state]) . <span class="stringliteral">&quot;&lt;/td&gt;&quot;</span>;
<a name="l00070"></a>00070                 echo <span class="stringliteral">&quot;&lt;td&gt;$row[title]&lt;/td&gt;&quot;</span>;
<a name="l00071"></a>00071                 echo <span class="stringliteral">&quot;&lt;td&gt;$row[name]&lt;/td&gt;&quot;</span>;
<a name="l00072"></a>00072                 echo <span class="stringliteral">&quot;&lt;td&gt;$row[numPositionsAvailable]&lt;/td&gt;&quot;</span>;
<a name="l00073"></a>00073                 echo <span class="stringliteral">&quot;&lt;td&gt;$row[payRate]&lt;/td&gt;&quot;</span>;
<a name="l00074"></a>00074                 echo <span class="stringliteral">&quot;&lt;td&gt;$row[semester]&lt;/td&gt;&quot;</span>;
<a name="l00075"></a>00075                 $desc = $row[dateAdded];
<a name="l00076"></a>00076                 <span class="comment">/* if (strlen($desc) &gt; 50) {</span>
<a name="l00077"></a>00077 <span class="comment">                 $desc = substr($desc, 0, -(strlen($desc) - 50)) . &quot;...&quot;;</span>
<a name="l00078"></a>00078 <span class="comment">                 } */</span>
<a name="l00079"></a>00079                 echo <span class="stringliteral">&quot;&lt;td&gt;$desc&lt;/td&gt;&quot;</span>;
<a name="l00080"></a>00080                 echo <span class="stringliteral">&quot;&lt;/tr&gt;&quot;</span>;
<a name="l00081"></a>00081         }
<a name="l00082"></a>00082         echo <span class="stringliteral">&quot;&lt;/table&gt;&quot;</span>;
<a name="l00083"></a>00083 }
<a name="l00084"></a>00084 
<a name="l00090"></a><a class="code" href="old_2inc_2functions_8php.html#aa8f7fe1db6603648ae2628aaf571ecc0">00090</a> <span class="keyword">function</span> <a class="code" href="old_2inc_2functions_8php.html#aa8f7fe1db6603648ae2628aaf571ecc0">filterPaid</a>() {
<a name="l00091"></a>00091 
<a name="l00092"></a>00092         $categories = <a class="code" href="logout_8php.html#aa3f93905a0a94ad29ddd47d9e5638098">$_SESSION</a>[<span class="stringliteral">&#39;category&#39;</span>];
<a name="l00093"></a>00093         <a class="code" href="internship__list__dateadded_8php.html#af59a5f7cd609e592c41dc3643efd3c98">$query</a> = <span class="stringliteral">&quot;SELECT o.city, o.state, o.name, io.* FROM INTERNSHIP_OPPORTUNITY io, ORGANIZATION o WHERE io.organizationID = o.OrganizationID AND io.categories LIKE &#39;%$categories%&#39; ORDER BY io.payRate DESC&quot;</span>;
<a name="l00094"></a>00094 
<a name="l00095"></a>00095         <a class="code" href="admin_2internship__list_8php.html#a112ef069ddc0454086e3d1e6d8d55d07">$result</a> = mysql_query(<a class="code" href="internship__list__dateadded_8php.html#af59a5f7cd609e592c41dc3643efd3c98">$query</a>);
<a name="l00096"></a>00096         <span class="keywordflow">if</span> (!<a class="code" href="admin_2internship__list_8php.html#a112ef069ddc0454086e3d1e6d8d55d07">$result</a>
<a name="l00097"></a>00097         )die(<span class="stringliteral">&quot;Could not complete query...&quot;</span>);
<a name="l00098"></a>00098         <a class="code" href="internship__list__dateadded_8php.html#a421991d6ab7f46f80cc1b5492e0c236e">$numRows</a> = mysql_num_rows(<a class="code" href="admin_2internship__list_8php.html#a112ef069ddc0454086e3d1e6d8d55d07">$result</a>);
<a name="l00099"></a>00099         echo <span class="stringliteral">&quot;&lt;table width=&#39;100%&#39; cellspacing=0&gt;&lt;tr&gt;&lt;td width=&#39;10%&#39;&gt;&lt;/td&gt;&lt;td&gt;&lt;b&gt;Location&lt;/b&gt;&lt;/td&gt;&lt;td&gt;&lt;b&gt;Position&lt;/b&gt;&lt;/td&gt;&lt;td&gt;&lt;b&gt;Company&lt;/b&gt;&lt;/td&gt;&lt;td width=&#39;10%&#39;&gt;&lt;b&gt;Positions Available&lt;/b&gt;&lt;/td&gt;&lt;td&gt;&lt;b&gt;Pay Rate&lt;/b&gt;&lt;/td&gt;&lt;td&gt;&lt;b&gt;Semester&lt;/b&gt;&lt;/td&gt;&lt;td width=&#39;30%&#39;&gt;&lt;b&gt;Date Added&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;&quot;</span>;
<a name="l00100"></a>00100         echo <span class="stringliteral">&quot;&lt;tr&gt;&lt;td colspan=8&gt;&lt;hr /&gt;&lt;/td&gt;&lt;/tr&gt;&quot;</span>;
<a name="l00101"></a>00101         <span class="keywordflow">for</span> ($x = 0; $x &lt; <a class="code" href="internship__list__dateadded_8php.html#a421991d6ab7f46f80cc1b5492e0c236e">$numRows</a>; $x++) {
<a name="l00102"></a>00102                 $row = mysql_fetch_assoc(<a class="code" href="admin_2internship__list_8php.html#a112ef069ddc0454086e3d1e6d8d55d07">$result</a>);
<a name="l00103"></a>00103                 <span class="keywordflow">if</span> ($x % 2 == 0) {
<a name="l00104"></a>00104                         echo <span class="stringliteral">&quot;&lt;tr&gt;&quot;</span>;
<a name="l00105"></a>00105                 } <span class="keywordflow">else</span> {
<a name="l00106"></a>00106                         echo <span class="stringliteral">&quot;&lt;tr bgcolor=&#39;#FBFBFB&#39;&gt;&quot;</span>;
<a name="l00107"></a>00107                 }
<a name="l00108"></a>00108                 echo <span class="stringliteral">&quot;&lt;td align=&#39;center&#39; valign=&#39;middle&#39;&gt;&lt;br /&gt;&lt;form action=&#39;index.php&#39; method=&#39;post&#39;&gt;&lt;input type=&#39;hidden&#39; name=&#39;viewCompany&#39; value=&#39;$row[organizationID]&#39;&gt;&lt;input type=&#39;submit&#39; value=&#39;View&#39; class=&#39;submit&#39; name=&#39;view&#39; /&gt;&lt;/form&gt;&lt;/td&gt;&quot;</span>;
<a name="l00109"></a>00109                 echo <span class="stringliteral">&quot;&lt;td&gt;$row[city], &quot;</span> . strtoupper($row[state]) . <span class="stringliteral">&quot;&lt;/td&gt;&quot;</span>;
<a name="l00110"></a>00110                 echo <span class="stringliteral">&quot;&lt;td&gt;$row[title]&lt;/td&gt;&quot;</span>;
<a name="l00111"></a>00111                 echo <span class="stringliteral">&quot;&lt;td&gt;$row[name]&lt;/td&gt;&quot;</span>;
<a name="l00112"></a>00112                 echo <span class="stringliteral">&quot;&lt;td&gt;$row[numPositionsAvailable]&lt;/td&gt;&quot;</span>;
<a name="l00113"></a>00113                 echo <span class="stringliteral">&quot;&lt;td&gt;$row[payRate]&lt;/td&gt;&quot;</span>;
<a name="l00114"></a>00114                 echo <span class="stringliteral">&quot;&lt;td&gt;$row[semester]&lt;/td&gt;&quot;</span>;
<a name="l00115"></a>00115                 $desc = $row[dateAdded];
<a name="l00116"></a>00116                 <span class="comment">/* if (strlen($desc) &gt; 50) {</span>
<a name="l00117"></a>00117 <span class="comment">                 $desc = substr($desc, 0, -(strlen($desc) - 50)) . &quot;...&quot;;</span>
<a name="l00118"></a>00118 <span class="comment">                 } */</span>
<a name="l00119"></a>00119                 echo <span class="stringliteral">&quot;&lt;td&gt;$desc&lt;/td&gt;&quot;</span>;
<a name="l00120"></a>00120                 echo <span class="stringliteral">&quot;&lt;/tr&gt;&quot;</span>;
<a name="l00121"></a>00121         }
<a name="l00122"></a>00122         echo <span class="stringliteral">&quot;&lt;/table&gt;&quot;</span>;
<a name="l00123"></a>00123 }
<a name="l00124"></a>00124 
<a name="l00130"></a><a class="code" href="old_2inc_2functions_8php.html#acc3aaf7747487320597223e9b51fc7b4">00130</a> <span class="keyword">function</span> <a class="code" href="old_2inc_2functions_8php.html#acc3aaf7747487320597223e9b51fc7b4">viewCompany</a>($ID) {
<a name="l00131"></a>00131         $company = mysql_query(<span class="stringliteral">&quot;SELECT name FROM organization WHERE organizationID=&#39;$ID&#39;&quot;</span>);
<a name="l00132"></a>00132         $row = mysql_fetch_assoc($company);
<a name="l00133"></a>00133         echo <span class="stringliteral">&quot;&lt;div align=&#39;left&#39;&gt;&lt;h1&gt;&quot;</span> . $row[name] . <span class="stringliteral">&quot;&lt;/h1&gt;&lt;/div&gt;&quot;</span>;
<a name="l00134"></a>00134         <a class="code" href="internship__list__dateadded_8php.html#af59a5f7cd609e592c41dc3643efd3c98">$query</a> = <span class="stringliteral">&quot;SELECT * FROM internship_opportunity WHERE organizationID=&#39;$ID&#39; ORDER BY semester&quot;</span>;
<a name="l00135"></a>00135         <a class="code" href="admin_2internship__list_8php.html#a112ef069ddc0454086e3d1e6d8d55d07">$result</a> = mysql_query(<a class="code" href="internship__list__dateadded_8php.html#af59a5f7cd609e592c41dc3643efd3c98">$query</a>);
<a name="l00136"></a>00136         <span class="keywordflow">if</span> (!<a class="code" href="admin_2internship__list_8php.html#a112ef069ddc0454086e3d1e6d8d55d07">$result</a>
<a name="l00137"></a>00137         )die(<span class="stringliteral">&quot;Could not complete query...&quot;</span>);
<a name="l00138"></a>00138         <a class="code" href="internship__list__dateadded_8php.html#a421991d6ab7f46f80cc1b5492e0c236e">$numRows</a> = mysql_num_rows(<a class="code" href="admin_2internship__list_8php.html#a112ef069ddc0454086e3d1e6d8d55d07">$result</a>);
<a name="l00139"></a>00139         echo <span class="stringliteral">&quot;&lt;table width=&#39;100%&#39; cellspacing=0&gt;&lt;tr&gt;&lt;td width=&#39;10%&#39;&gt;&lt;/td&gt;&lt;td&gt;&lt;b&gt;Title&lt;/b&gt;&lt;/td&gt;&lt;td width=&#39;10%&#39;&gt;&lt;b&gt;Positions Available&lt;/b&gt;&lt;/td&gt;&lt;td&gt;&lt;b&gt;Semester&lt;/b&gt;&lt;/td&gt;&lt;td&gt;&lt;b&gt;Paid&lt;/b&gt;&lt;/td&gt;&lt;td&gt;&lt;b&gt;Duration&lt;/b&gt;&lt;/td&gt;&lt;td&gt;&lt;b&gt;Date Added&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;&quot;</span>;
<a name="l00140"></a>00140         echo <span class="stringliteral">&quot;&lt;tr&gt;&lt;td colspan=7&gt;&lt;hr /&gt;&lt;/td&gt;&lt;/tr&gt;&quot;</span>;
<a name="l00141"></a>00141         <span class="keywordflow">for</span> ($x = 0; $x &lt; <a class="code" href="internship__list__dateadded_8php.html#a421991d6ab7f46f80cc1b5492e0c236e">$numRows</a>; $x++) {
<a name="l00142"></a>00142                 $row = mysql_fetch_assoc(<a class="code" href="admin_2internship__list_8php.html#a112ef069ddc0454086e3d1e6d8d55d07">$result</a>);
<a name="l00143"></a>00143                 <span class="keywordflow">if</span> ($x % 2 == 0) {
<a name="l00144"></a>00144                         echo <span class="stringliteral">&quot;&lt;tr&gt;&quot;</span>;
<a name="l00145"></a>00145                 } <span class="keywordflow">else</span> {
<a name="l00146"></a>00146                         echo <span class="stringliteral">&quot;&lt;tr bgcolor=&#39;#FBFBFB&#39;&gt;&quot;</span>;
<a name="l00147"></a>00147                 }
<a name="l00148"></a>00148                 echo <span class="stringliteral">&quot;&lt;td align=&#39;center&#39; valign=&#39;middle&#39;&gt;&lt;br /&gt;&lt;form action=&#39;index.php&#39; method=&#39;post&#39;&gt;&lt;input type=&#39;hidden&#39; name=&#39;opportunityID&#39; value=&#39;$row[opportunityID]&#39;&gt;&lt;input type=&#39;submit&#39; value=&#39;View&#39; class=&#39;submit&#39; name=&#39;view&#39; /&gt;&lt;/form&gt;&lt;/td&gt;&quot;</span>;
<a name="l00149"></a>00149                 echo <span class="stringliteral">&quot;&lt;td&gt;$row[title]&lt;/td&gt;&quot;</span>;
<a name="l00150"></a>00150                 echo <span class="stringliteral">&quot;&lt;td&gt;$row[numPositionsAvailable]&lt;/td&gt;&quot;</span>;
<a name="l00151"></a>00151                 echo <span class="stringliteral">&quot;&lt;td&gt;$row[semester]&lt;/td&gt;&quot;</span>;
<a name="l00152"></a>00152                 echo <span class="stringliteral">&quot;&lt;td&gt;$row[payRate]&lt;/td&gt;&quot;</span>;
<a name="l00153"></a>00153                 echo <span class="stringliteral">&quot;&lt;td&gt;$row[duration]&lt;/td&gt;&quot;</span>;
<a name="l00154"></a>00154                 echo <span class="stringliteral">&quot;&lt;td&gt;&lt;/td&gt;&quot;</span>;
<a name="l00155"></a>00155                 echo <span class="stringliteral">&quot;&lt;/tr&gt;&quot;</span>;
<a name="l00156"></a>00156         }
<a name="l00157"></a>00157         echo <span class="stringliteral">&quot;&lt;/table&gt;&quot;</span>;
<a name="l00158"></a>00158 }
<a name="l00159"></a>00159 
<a name="l00165"></a><a class="code" href="old_2inc_2functions_8php.html#a70dc3371559a476fc50529b9854e289c">00165</a> <span class="keyword">function</span> <a class="code" href="old_2inc_2functions_8php.html#a70dc3371559a476fc50529b9854e289c">filterLocation</a>(<a class="code" href="old_2internship-request_8php.html#a5b9ddd3e3a69d8901270064346bdef49">$city</a>) {
<a name="l00166"></a>00166 
<a name="l00167"></a>00167         <a class="code" href="admin_2internship__list_8php.html#a112ef069ddc0454086e3d1e6d8d55d07">$result</a> = mysql_query(<span class="stringliteral">&quot;SELECT DISTINCT city FROM organization&quot;</span>);
<a name="l00168"></a>00168         <span class="keywordflow">if</span> (!<a class="code" href="admin_2internship__list_8php.html#a112ef069ddc0454086e3d1e6d8d55d07">$result</a>
<a name="l00169"></a>00169         )die(<span class="stringliteral">&quot;Could not complete the query...&quot;</span>);
<a name="l00170"></a>00170         <a class="code" href="internship__list__dateadded_8php.html#a421991d6ab7f46f80cc1b5492e0c236e">$numRows</a> = mysql_num_rows(<a class="code" href="admin_2internship__list_8php.html#a112ef069ddc0454086e3d1e6d8d55d07">$result</a>);
<a name="l00171"></a>00171         echo <span class="stringliteral">&quot;&lt;form action=&#39;index.php&#39; method=&#39;post&#39;&gt;&quot;</span>;
<a name="l00172"></a>00172         echo <span class="stringliteral">&quot;&lt;div align=&#39;left&#39;&gt;City: &lt;select onchange=&#39;this.form.submit()&#39; name=&#39;cityChange&#39;&gt;&lt;/div&gt;&quot;</span>;
<a name="l00173"></a>00173         <span class="keywordflow">if</span> (<a class="code" href="old_2internship-request_8php.html#a5b9ddd3e3a69d8901270064346bdef49">$city</a> == null) {
<a name="l00174"></a>00174                 echo <span class="stringliteral">&quot;&lt;option value=&#39;&#39;&gt;Select a city...&lt;/option&gt;&quot;</span>;
<a name="l00175"></a>00175         }
<a name="l00176"></a>00176         <span class="keywordflow">for</span> ($i = 0; $i &lt; <a class="code" href="internship__list__dateadded_8php.html#a421991d6ab7f46f80cc1b5492e0c236e">$numRows</a>; $i++) {
<a name="l00177"></a>00177                 $row = mysql_fetch_assoc(<a class="code" href="admin_2internship__list_8php.html#a112ef069ddc0454086e3d1e6d8d55d07">$result</a>);
<a name="l00178"></a>00178                 <span class="keywordflow">if</span> (strcmp($row[city], <a class="code" href="old_2internship-request_8php.html#a5b9ddd3e3a69d8901270064346bdef49">$city</a>) == 0) {
<a name="l00179"></a>00179                         echo <span class="stringliteral">&quot;&lt;option SELECTED value=&#39;$row[city]&#39;&gt;$row[city]&lt;/option&gt;&quot;</span>;
<a name="l00180"></a>00180                 } <span class="keywordflow">else</span> {
<a name="l00181"></a>00181                         echo <span class="stringliteral">&quot;&lt;option value=&#39;$row[city]&#39;&gt;$row[city]&lt;/option&gt;&quot;</span>;
<a name="l00182"></a>00182                 }
<a name="l00183"></a>00183         }
<a name="l00184"></a>00184         echo <span class="stringliteral">&quot;&lt;/select&gt;&quot;</span>;
<a name="l00185"></a>00185         echo <span class="stringliteral">&quot;&lt;/form&gt;&quot;</span>;
<a name="l00186"></a>00186         <a class="code" href="internship__list__dateadded_8php.html#a18b2a8d133fa7733bf34abcc6ca2ef5b">$category</a> = <a class="code" href="logout_8php.html#aa3f93905a0a94ad29ddd47d9e5638098">$_SESSION</a>[<span class="stringliteral">&#39;category&#39;</span>];
<a name="l00187"></a>00187         <span class="keywordflow">if</span> (<a class="code" href="old_2internship-request_8php.html#a5b9ddd3e3a69d8901270064346bdef49">$city</a> == null) {
<a name="l00188"></a>00188                 <a class="code" href="internship__list__dateadded_8php.html#af59a5f7cd609e592c41dc3643efd3c98">$query</a> = <span class="stringliteral">&quot;SELECT o.city, o.state, o.name, io.* FROM INTERNSHIP_OPPORTUNITY io, ORGANIZATION o WHERE io.organizationID = o.OrganizationID AND io.categories LIKE &#39;%$category%&#39; ORDER BY o.city&quot;</span>;
<a name="l00189"></a>00189         } <span class="keywordflow">else</span> {
<a name="l00190"></a>00190                 <a class="code" href="internship__list__dateadded_8php.html#af59a5f7cd609e592c41dc3643efd3c98">$query</a> = <span class="stringliteral">&quot;SELECT o.city, o.state, o.name, io.* FROM INTERNSHIP_OPPORTUNITY io, ORGANIZATION o WHERE io.organizationID = o.OrganizationID AND o.city=&#39;$city&#39; AND io.categories LIKE &#39;%$category%&#39; ORDER BY io.dateAdded DESC&quot;</span>;
<a name="l00191"></a>00191         }
<a name="l00192"></a>00192 
<a name="l00193"></a>00193         <a class="code" href="admin_2internship__list_8php.html#a112ef069ddc0454086e3d1e6d8d55d07">$result</a> = mysql_query(<a class="code" href="internship__list__dateadded_8php.html#af59a5f7cd609e592c41dc3643efd3c98">$query</a>);
<a name="l00194"></a>00194         <span class="keywordflow">if</span> (!<a class="code" href="admin_2internship__list_8php.html#a112ef069ddc0454086e3d1e6d8d55d07">$result</a>
<a name="l00195"></a>00195 
<a name="l00196"></a>00196         )die(<span class="stringliteral">&quot;Could not complete query...&quot;</span>);
<a name="l00197"></a>00197         $numRows = mysql_num_rows(<a class="code" href="admin_2internship__list_8php.html#a112ef069ddc0454086e3d1e6d8d55d07">$result</a>);
<a name="l00198"></a>00198         echo <span class="stringliteral">&quot;&lt;table width=&#39;100%&#39; cellspacing=0&gt;&lt;tr&gt;&lt;td width=&#39;10%&#39;&gt;&lt;/td&gt;&lt;td&gt;&lt;b&gt;Location&lt;/b&gt;&lt;/td&gt;&lt;td&gt;&lt;b&gt;Position&lt;/b&gt;&lt;/td&gt;&lt;td&gt;&lt;b&gt;Company&lt;/b&gt;&lt;/td&gt;&lt;td width=&#39;10%&#39;&gt;&lt;b&gt;Positions Available&lt;/b&gt;&lt;/td&gt;&lt;td&gt;&lt;b&gt;Pay Rate&lt;/b&gt;&lt;/td&gt;&lt;td&gt;&lt;b&gt;Semester&lt;/b&gt;&lt;/td&gt;&lt;td width=&#39;30%&#39;&gt;&lt;b&gt;Date Added&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;&quot;</span>;
<a name="l00199"></a>00199         echo <span class="stringliteral">&quot;&lt;tr&gt;&lt;td colspan=8&gt;&lt;hr /&gt;&lt;/td&gt;&lt;/tr&gt;&quot;</span>;
<a name="l00200"></a>00200         <span class="keywordflow">for</span> ($x = 0; $x &lt; <a class="code" href="internship__list__dateadded_8php.html#a421991d6ab7f46f80cc1b5492e0c236e">$numRows</a>; $x++) {
<a name="l00201"></a>00201                 $row = mysql_fetch_assoc(<a class="code" href="admin_2internship__list_8php.html#a112ef069ddc0454086e3d1e6d8d55d07">$result</a>);
<a name="l00202"></a>00202                 <span class="keywordflow">if</span> ($x % 2 == 0) {
<a name="l00203"></a>00203                         echo <span class="stringliteral">&quot;&lt;tr&gt;&quot;</span>;
<a name="l00204"></a>00204                 } <span class="keywordflow">else</span> {
<a name="l00205"></a>00205                         echo <span class="stringliteral">&quot;&lt;tr bgcolor=&#39;#FBFBFB&#39;&gt;&quot;</span>;
<a name="l00206"></a>00206                 }
<a name="l00207"></a>00207                 echo <span class="stringliteral">&quot;&lt;td align=&#39;center&#39; valign=&#39;middle&#39;&gt;&lt;br /&gt;&lt;form action=&#39;index.php&#39; method=&#39;post&#39;&gt;&lt;input type=&#39;hidden&#39; name=&#39;viewCompany&#39; value=&#39;$row[organizationID]&#39;&gt;&lt;input type=&#39;submit&#39; value=&#39;View&#39; class=&#39;submit&#39; name=&#39;view&#39; /&gt;&lt;/form&gt;&lt;/td&gt;&quot;</span>;
<a name="l00208"></a>00208                 echo <span class="stringliteral">&quot;&lt;td&gt;$row[city], &quot;</span> . strtoupper($row[state]) . <span class="stringliteral">&quot;&lt;/td&gt;&quot;</span>;
<a name="l00209"></a>00209                 echo <span class="stringliteral">&quot;&lt;td&gt;$row[title]&lt;/td&gt;&quot;</span>;
<a name="l00210"></a>00210                 echo <span class="stringliteral">&quot;&lt;td&gt;$row[name]&lt;/td&gt;&quot;</span>;
<a name="l00211"></a>00211                 echo <span class="stringliteral">&quot;&lt;td&gt;$row[numPositionsAvailable]&lt;/td&gt;&quot;</span>;
<a name="l00212"></a>00212                 echo <span class="stringliteral">&quot;&lt;td&gt;$row[payRate]&lt;/td&gt;&quot;</span>;
<a name="l00213"></a>00213                 echo <span class="stringliteral">&quot;&lt;td&gt;$row[semester]&lt;/td&gt;&quot;</span>;
<a name="l00214"></a>00214                 $desc = $row[dateAdded];
<a name="l00215"></a>00215                 <span class="comment">/* if (strlen($desc) &gt; 50) {</span>
<a name="l00216"></a>00216 <span class="comment">                 $desc = substr($desc, 0, -(strlen($desc) - 50)) . &quot;...&quot;;</span>
<a name="l00217"></a>00217 <span class="comment">                 } */</span>
<a name="l00218"></a>00218                 echo <span class="stringliteral">&quot;&lt;td&gt;$desc&lt;/td&gt;&quot;</span>;
<a name="l00219"></a>00219                 echo <span class="stringliteral">&quot;&lt;/tr&gt;&quot;</span>;
<a name="l00220"></a>00220         }
<a name="l00221"></a>00221         echo <span class="stringliteral">&quot;&lt;/table&gt;&quot;</span>;
<a name="l00222"></a>00222 }
<a name="l00223"></a>00223 
<a name="l00229"></a><a class="code" href="old_2inc_2functions_8php.html#a273a92a70827a0af04a320d529d15e52">00229</a> <span class="keyword">function</span> <a class="code" href="old_2inc_2functions_8php.html#a273a92a70827a0af04a320d529d15e52">filterCompany</a>() {
<a name="l00230"></a>00230         <a class="code" href="internship__list__dateadded_8php.html#af59a5f7cd609e592c41dc3643efd3c98">$query</a> = <span class="stringliteral">&quot;SELECT * FROM ORGANIZATION ORDER BY name&quot;</span>;
<a name="l00231"></a>00231         <a class="code" href="admin_2internship__list_8php.html#a112ef069ddc0454086e3d1e6d8d55d07">$result</a> = mysql_query(<a class="code" href="internship__list__dateadded_8php.html#af59a5f7cd609e592c41dc3643efd3c98">$query</a>);
<a name="l00232"></a>00232         <span class="keywordflow">if</span> (!<a class="code" href="admin_2internship__list_8php.html#a112ef069ddc0454086e3d1e6d8d55d07">$result</a>
<a name="l00233"></a>00233 
<a name="l00234"></a>00234         )die(<span class="stringliteral">&quot;Could not complete query...&quot;</span>);
<a name="l00235"></a>00235         <a class="code" href="internship__list__dateadded_8php.html#a421991d6ab7f46f80cc1b5492e0c236e">$numRows</a> = mysql_num_rows(<a class="code" href="admin_2internship__list_8php.html#a112ef069ddc0454086e3d1e6d8d55d07">$result</a>);
<a name="l00236"></a>00236         echo <span class="stringliteral">&quot;&lt;table width=&#39;100%&#39; cellspacing=0&gt;&lt;tr&gt;&lt;td width=&#39;10%&#39;&gt;&lt;/td&gt;&lt;td&gt;&lt;b&gt;Name&lt;/b&gt;&lt;/td&gt;&lt;td&gt;&lt;b&gt;Address&lt;/b&gt;&lt;/td&gt;&lt;td&gt;&lt;b&gt;City&lt;/b&gt;&lt;/td&gt;&lt;td&gt;&lt;b&gt;State&lt;/b&gt;&lt;/td&gt;&lt;td&gt;&lt;b&gt;Zip&lt;/b&gt;&lt;/td&gt;&lt;td width=&#39;30%&#39;&gt;&lt;b&gt;Description&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;&quot;</span>;
<a name="l00237"></a>00237         echo <span class="stringliteral">&quot;&lt;tr&gt;&lt;td colspan=7&gt;&lt;hr /&gt;&lt;/td&gt;&lt;/tr&gt;&quot;</span>;
<a name="l00238"></a>00238         <span class="keywordflow">for</span> ($x = 0; $x &lt; <a class="code" href="internship__list__dateadded_8php.html#a421991d6ab7f46f80cc1b5492e0c236e">$numRows</a>; $x++) {
<a name="l00239"></a>00239                 $row = mysql_fetch_assoc(<a class="code" href="admin_2internship__list_8php.html#a112ef069ddc0454086e3d1e6d8d55d07">$result</a>);
<a name="l00240"></a>00240                 <span class="keywordflow">if</span> ($x % 2 == 0) {
<a name="l00241"></a>00241                         echo <span class="stringliteral">&quot;&lt;tr&gt;&quot;</span>;
<a name="l00242"></a>00242                 } <span class="keywordflow">else</span> {
<a name="l00243"></a>00243                         echo <span class="stringliteral">&quot;&lt;tr bgcolor=&#39;#FBFBFB&#39;&gt;&quot;</span>;
<a name="l00244"></a>00244                 }
<a name="l00245"></a>00245                 echo <span class="stringliteral">&quot;&lt;td align=&#39;center&#39; valign=&#39;middle&#39;&gt;&lt;br /&gt;&lt;form action=&#39;index.php&#39; method=&#39;post&#39;&gt;&lt;input type=&#39;hidden&#39; name=&#39;viewCompany&#39; value=&#39;$row[organizationID]&#39;&gt;&lt;input type=&#39;submit&#39; value=&#39;View&#39; class=&#39;submit&#39; name=&#39;view&#39; /&gt;&lt;/form&gt;&lt;/td&gt;&quot;</span>;
<a name="l00246"></a>00246                 echo <span class="stringliteral">&quot;&lt;td&gt;$row[name]&lt;/td&gt;&quot;</span>;
<a name="l00247"></a>00247                 echo <span class="stringliteral">&quot;&lt;td&gt;$row[address]&lt;/td&gt;&quot;</span>;
<a name="l00248"></a>00248                 echo <span class="stringliteral">&quot;&lt;td&gt;$row[city]&lt;/td&gt;&quot;</span>;
<a name="l00249"></a>00249                 echo <span class="stringliteral">&quot;&lt;td&gt;&quot;</span> . strtoupper($row[state]) . <span class="stringliteral">&quot;&lt;/td&gt;&quot;</span>;
<a name="l00250"></a>00250                 echo <span class="stringliteral">&quot;&lt;td&gt;$row[zip]&lt;/td&gt;&quot;</span>;
<a name="l00251"></a>00251                 $desc = $row[companyDescription];
<a name="l00252"></a>00252                 <span class="keywordflow">if</span> (strlen($desc) &gt; 50) {
<a name="l00253"></a>00253                         $desc = substr($desc, 0, -(strlen($desc) - 50)) . <span class="stringliteral">&quot;...&quot;</span>;
<a name="l00254"></a>00254                 }
<a name="l00255"></a>00255                 echo <span class="stringliteral">&quot;&lt;td&gt;$desc&lt;/td&gt;&quot;</span>;
<a name="l00256"></a>00256                 echo <span class="stringliteral">&quot;&lt;/tr&gt;&quot;</span>;
<a name="l00257"></a>00257         }
<a name="l00258"></a>00258         echo <span class="stringliteral">&quot;&lt;/table&gt;&quot;</span>;
<a name="l00259"></a>00259 }
<a name="l00260"></a>00260 
<a name="l00266"></a><a class="code" href="old_2inc_2functions_8php.html#a61006d44ae8ce17e621047df954d5ab5">00266</a> <span class="keyword">function</span> <a class="code" href="db-control_2inc_2functions_8php.html#a61006d44ae8ce17e621047df954d5ab5">sanitizeStr</a>($str) {
<a name="l00267"></a>00267         $str = strip_tags($str);
<a name="l00268"></a>00268         $str = addslashes($str);
<a name="l00269"></a>00269         <span class="keywordflow">return</span> $str;
<a name="l00270"></a>00270 }
<a name="l00271"></a>00271 
<a name="l00277"></a><a class="code" href="old_2inc_2functions_8php.html#ac2f59bd4faf01600f3d667f745c06367">00277</a> <span class="keyword">function</span> <a class="code" href="db-control_2inc_2functions_8php.html#ac2f59bd4faf01600f3d667f745c06367">restoreStr</a>($str) {
<a name="l00278"></a>00278         $str = stripslashes($str);
<a name="l00279"></a>00279         <span class="keywordflow">return</span> $str;
<a name="l00280"></a>00280 }
<a name="l00281"></a>00281 
<a name="l00282"></a>00282 
<a name="l00283"></a>00283 
<a name="l00284"></a>00284 ?&gt;
</pre></div></div>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>



<hr class="footer"/><address class="footer"><small>
Generated on Tue Nov 29 2011 18:18:54 for i2c by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.5.1
</small></address>

</body>
</html>
